﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Runtime.Serialization.Json;
using Model;
using System.Web.Script.Serialization;

namespace BugSysSolution.AjaxPaging
{
    public partial class test1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            String tag = Request["tag"] ?? String.Empty;

            if (tag == "s")
            {
                Users us1 = new Users();
                us1.RealName = "x1";
                us1.PassWord = "x2";

                Users us2 = new Users();
                us2.RealName = "xxx1";
                us2.PassWord = "xxx2";

                List<Users> list = new List<Users>();
                list.Add(us1);

                String str = CommonCs.Common.DataTableToJson(CommonCs.Common.ListToDataTable<Users>(list));

                //String str = CommonCs.Common.ObjectToJson(us1);

                Response.Write(str);
            }

            if (tag == "ajaxpage")
            {
                string index = Request.QueryString["index"].ToString();
                string size = Request.QueryString["size"].ToString();
                Response.Write("");
            }

            if (tag =="getall")
            {
                Response.Write("");
            }
        }

        public string getvalue() 
        {
            Users us1 = new Users();
            us1.RealName = "x1";
            us1.PassWord = "xx1";
            us1.QQ = "111";

            Users us2 = new Users();
            us2.RealName = "x2";
            us2.PassWord = "xx2";
            us2.QQ = "222";

            Users us3 = new Users();
            us3.RealName = "x3";
            us3.PassWord = "xx3";
            us3.QQ = "333";

            List<Users> list = new List<Users>();
            list.Add(us1);
            list.Add(us2);
            list.Add(us3);

            String str = CommonCs.Common.DataTableToJson(CommonCs.Common.ListToDataTable<Users>(list));

            return str;
        }
    }
}